using System;
using System.Collections.Generic;
using Android.Runtime;

namespace Com.Iflytek.Speech {

	[Register ("com/iflytek/speech/WakeuperListener", "", "Com.Iflytek.Speech.IWakeuperListenerInvoker")]
	public partial interface IWakeuperListener : IJavaObject {

		[Register ("onBeginOfSpeech", "()V", "GetOnBeginOfSpeechHandler:Com.Iflytek.Speech.IWakeuperListenerInvoker, IFlyBinding")]
		void OnBeginOfSpeech ();

		[Register ("onEndOfSpeech", "()V", "GetOnEndOfSpeechHandler:Com.Iflytek.Speech.IWakeuperListenerInvoker, IFlyBinding")]
		void OnEndOfSpeech ();

		[Register ("onError", "(I)V", "GetOnError_IHandler:Com.Iflytek.Speech.IWakeuperListenerInvoker, IFlyBinding")]
		void OnError (int p0);

		[Register ("onResult", "(Lcom/iflytek/speech/WakeuperResult;)V", "GetOnResult_Lcom_iflytek_speech_WakeuperResult_Handler:Com.Iflytek.Speech.IWakeuperListenerInvoker, IFlyBinding")]
		void OnResult (global::Com.Iflytek.Speech.WakeuperResult p0);

		[Register ("onVolumeChanged", "(I)V", "GetOnVolumeChanged_IHandler:Com.Iflytek.Speech.IWakeuperListenerInvoker, IFlyBinding")]
		void OnVolumeChanged (int paramW);

	}

	[global::Android.Runtime.Register ("com/iflytek/speech/WakeuperListener", DoNotGenerateAcw=true)]
	internal class IWakeuperListenerInvoker : global::Java.Lang.Object, IWakeuperListener {

		static IntPtr java_class_ref = JNIEnv.FindClass ("com/iflytek/speech/WakeuperListener");
		IntPtr class_ref;

		public static IWakeuperListener GetObject (IntPtr handle, JniHandleOwnership transfer)
		{
			return global::Java.Lang.Object.GetObject<IWakeuperListener> (handle, transfer);
		}

		static IntPtr Validate (IntPtr handle)
		{
			if (!JNIEnv.IsInstanceOf (handle, java_class_ref))
				throw new InvalidCastException (string.Format ("Unable to convert instance of type '{0}' to type '{1}'.",
							JNIEnv.GetClassNameFromInstance (handle), "com.iflytek.speech.WakeuperListener"));
			return handle;
		}

		protected override void Dispose (bool disposing)
		{
			if (this.class_ref != IntPtr.Zero)
				JNIEnv.DeleteGlobalRef (this.class_ref);
			this.class_ref = IntPtr.Zero;
			base.Dispose (disposing);
		}

		public IWakeuperListenerInvoker (IntPtr handle, JniHandleOwnership transfer) : base (Validate (handle), transfer)
		{
			IntPtr local_ref = JNIEnv.GetObjectClass (Handle);
			this.class_ref = JNIEnv.NewGlobalRef (local_ref);
			JNIEnv.DeleteLocalRef (local_ref);
		}

		protected override IntPtr ThresholdClass {
			get { return class_ref; }
		}

		protected override System.Type ThresholdType {
			get { return typeof (IWakeuperListenerInvoker); }
		}

		static Delegate cb_onBeginOfSpeech;
#pragma warning disable 0169
		static Delegate GetOnBeginOfSpeechHandler ()
		{
			if (cb_onBeginOfSpeech == null)
				cb_onBeginOfSpeech = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr>) n_OnBeginOfSpeech);
			return cb_onBeginOfSpeech;
		}

		static void n_OnBeginOfSpeech (IntPtr jnienv, IntPtr native__this)
		{
			global::Com.Iflytek.Speech.IWakeuperListener __this = global::Java.Lang.Object.GetObject<global::Com.Iflytek.Speech.IWakeuperListener> (native__this, JniHandleOwnership.DoNotTransfer);
			__this.OnBeginOfSpeech ();
		}
#pragma warning restore 0169

		IntPtr id_onBeginOfSpeech;
		public void OnBeginOfSpeech ()
		{
			if (id_onBeginOfSpeech == IntPtr.Zero)
				id_onBeginOfSpeech = JNIEnv.GetMethodID (class_ref, "onBeginOfSpeech", "()V");
			JNIEnv.CallVoidMethod (Handle, id_onBeginOfSpeech);
		}

		static Delegate cb_onEndOfSpeech;
#pragma warning disable 0169
		static Delegate GetOnEndOfSpeechHandler ()
		{
			if (cb_onEndOfSpeech == null)
				cb_onEndOfSpeech = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr>) n_OnEndOfSpeech);
			return cb_onEndOfSpeech;
		}

		static void n_OnEndOfSpeech (IntPtr jnienv, IntPtr native__this)
		{
			global::Com.Iflytek.Speech.IWakeuperListener __this = global::Java.Lang.Object.GetObject<global::Com.Iflytek.Speech.IWakeuperListener> (native__this, JniHandleOwnership.DoNotTransfer);
			__this.OnEndOfSpeech ();
		}
#pragma warning restore 0169

		IntPtr id_onEndOfSpeech;
		public void OnEndOfSpeech ()
		{
			if (id_onEndOfSpeech == IntPtr.Zero)
				id_onEndOfSpeech = JNIEnv.GetMethodID (class_ref, "onEndOfSpeech", "()V");
			JNIEnv.CallVoidMethod (Handle, id_onEndOfSpeech);
		}

		static Delegate cb_onError_I;
#pragma warning disable 0169
		static Delegate GetOnError_IHandler ()
		{
			if (cb_onError_I == null)
				cb_onError_I = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr, int>) n_OnError_I);
			return cb_onError_I;
		}

		static void n_OnError_I (IntPtr jnienv, IntPtr native__this, int p0)
		{
			global::Com.Iflytek.Speech.IWakeuperListener __this = global::Java.Lang.Object.GetObject<global::Com.Iflytek.Speech.IWakeuperListener> (native__this, JniHandleOwnership.DoNotTransfer);
			__this.OnError (p0);
		}
#pragma warning restore 0169

		IntPtr id_onError_I;
		public void OnError (int p0)
		{
			if (id_onError_I == IntPtr.Zero)
				id_onError_I = JNIEnv.GetMethodID (class_ref, "onError", "(I)V");
			JNIEnv.CallVoidMethod (Handle, id_onError_I, new JValue (p0));
		}

		static Delegate cb_onResult_Lcom_iflytek_speech_WakeuperResult_;
#pragma warning disable 0169
		static Delegate GetOnResult_Lcom_iflytek_speech_WakeuperResult_Handler ()
		{
			if (cb_onResult_Lcom_iflytek_speech_WakeuperResult_ == null)
				cb_onResult_Lcom_iflytek_speech_WakeuperResult_ = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr, IntPtr>) n_OnResult_Lcom_iflytek_speech_WakeuperResult_);
			return cb_onResult_Lcom_iflytek_speech_WakeuperResult_;
		}

		static void n_OnResult_Lcom_iflytek_speech_WakeuperResult_ (IntPtr jnienv, IntPtr native__this, IntPtr native_p0)
		{
			global::Com.Iflytek.Speech.IWakeuperListener __this = global::Java.Lang.Object.GetObject<global::Com.Iflytek.Speech.IWakeuperListener> (native__this, JniHandleOwnership.DoNotTransfer);
			global::Com.Iflytek.Speech.WakeuperResult p0 = global::Java.Lang.Object.GetObject<global::Com.Iflytek.Speech.WakeuperResult> (native_p0, JniHandleOwnership.DoNotTransfer);
			__this.OnResult (p0);
		}
#pragma warning restore 0169

		IntPtr id_onResult_Lcom_iflytek_speech_WakeuperResult_;
		public void OnResult (global::Com.Iflytek.Speech.WakeuperResult p0)
		{
			if (id_onResult_Lcom_iflytek_speech_WakeuperResult_ == IntPtr.Zero)
				id_onResult_Lcom_iflytek_speech_WakeuperResult_ = JNIEnv.GetMethodID (class_ref, "onResult", "(Lcom/iflytek/speech/WakeuperResult;)V");
			JNIEnv.CallVoidMethod (Handle, id_onResult_Lcom_iflytek_speech_WakeuperResult_, new JValue (p0));
		}

		static Delegate cb_onVolumeChanged_I;
#pragma warning disable 0169
		static Delegate GetOnVolumeChanged_IHandler ()
		{
			if (cb_onVolumeChanged_I == null)
				cb_onVolumeChanged_I = JNINativeWrapper.CreateDelegate ((Action<IntPtr, IntPtr, int>) n_OnVolumeChanged_I);
			return cb_onVolumeChanged_I;
		}

		static void n_OnVolumeChanged_I (IntPtr jnienv, IntPtr native__this, int paramW)
		{
			global::Com.Iflytek.Speech.IWakeuperListener __this = global::Java.Lang.Object.GetObject<global::Com.Iflytek.Speech.IWakeuperListener> (native__this, JniHandleOwnership.DoNotTransfer);
			__this.OnVolumeChanged (paramW);
		}
#pragma warning restore 0169

		IntPtr id_onVolumeChanged_I;
		public void OnVolumeChanged (int paramW)
		{
			if (id_onVolumeChanged_I == IntPtr.Zero)
				id_onVolumeChanged_I = JNIEnv.GetMethodID (class_ref, "onVolumeChanged", "(I)V");
			JNIEnv.CallVoidMethod (Handle, id_onVolumeChanged_I, new JValue (paramW));
		}

	}

	public partial class ErrorEventArgs : global::System.EventArgs {

		public ErrorEventArgs (int p0)
		{
			this.p0 = p0;
		}

		int p0;
		public int P0 {
			get { return p0; }
		}
	}

	public partial class ResultEventArgs : global::System.EventArgs {

		public ResultEventArgs (global::Com.Iflytek.Speech.WakeuperResult p0)
		{
			this.p0 = p0;
		}

		global::Com.Iflytek.Speech.WakeuperResult p0;
		public global::Com.Iflytek.Speech.WakeuperResult P0 {
			get { return p0; }
		}
	}

	public partial class VolumeChangedEventArgs : global::System.EventArgs {

		public VolumeChangedEventArgs (int w)
		{
			this.paramW = w;
		}

		int paramW;
		public int ParamW {
			get { return paramW; }
		}
	}

	[global::Android.Runtime.Register ("mono/com/iflytek/speech/WakeuperListenerImplementor")]
	internal sealed class IWakeuperListenerImplementor : global::Java.Lang.Object, IWakeuperListener {

		object sender;

		public IWakeuperListenerImplementor (object sender)
			: base (global::Android.Runtime.JNIEnv.CreateInstance ("mono/com/iflytek/speech/WakeuperListenerImplementor", "()V"), JniHandleOwnership.TransferLocalRef)
		{
			this.sender = sender;
		}

#pragma warning disable 0649
		public EventHandler OnBeginOfSpeechHandler;
#pragma warning restore 0649

		public void OnBeginOfSpeech ()
		{
			if (OnBeginOfSpeechHandler != null)
				OnBeginOfSpeechHandler (sender, new EventArgs ());
		}
#pragma warning disable 0649
		public EventHandler OnEndOfSpeechHandler;
#pragma warning restore 0649

		public void OnEndOfSpeech ()
		{
			if (OnEndOfSpeechHandler != null)
				OnEndOfSpeechHandler (sender, new EventArgs ());
		}
#pragma warning disable 0649
		public EventHandler<ErrorEventArgs> OnErrorHandler;
#pragma warning restore 0649

		public void OnError (int p0)
		{
			if (OnErrorHandler != null)
				OnErrorHandler (sender, new ErrorEventArgs (p0));
		}
#pragma warning disable 0649
		public EventHandler<ResultEventArgs> OnResultHandler;
#pragma warning restore 0649

		public void OnResult (global::Com.Iflytek.Speech.WakeuperResult p0)
		{
			if (OnResultHandler != null)
				OnResultHandler (sender, new ResultEventArgs (p0));
		}
#pragma warning disable 0649
		public EventHandler<VolumeChangedEventArgs> OnVolumeChangedHandler;
#pragma warning restore 0649

		public void OnVolumeChanged (int paramW)
		{
			if (OnVolumeChangedHandler != null)
				OnVolumeChangedHandler (sender, new VolumeChangedEventArgs (paramW));
		}

		internal static bool __IsEmpty (IWakeuperListenerImplementor value)
		{
			return value.OnBeginOfSpeechHandler == null && value.OnEndOfSpeechHandler == null && value.OnErrorHandler == null && value.OnResultHandler == null && value.OnVolumeChangedHandler == null;
		}
	}

}
